package com.clkj.mobileinspector.utils;

import java.util.Random;

/**
 * @author 松
 * 2020/9/16 08:53
 */
public class RandomStringUtils {

    /**
     * 生成随机字符串
     * @param length 长度
     * @return
     */
    public static String getRandomString(int length) { //length表示生成字符串的长度
        String base = "abcdef0123456789";
        Random random = new Random();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < length; i++) {
            int number = random.nextInt(base.length());
            sb.append(base.charAt(number));
        }
        return sb.toString();
    }
}
